<template>
  <div class="ad" @click="toAD">
    <img src="@/assets/images/banner.jpg" alt="" />
  </div>
</template>

<script setup>
const toAD = () => {
  const urlPath = 'https://mall.51yiyun.cn/shop/apps/mplink/client/index?id=12'

  console.log('click')
  Hejia.ready(function () {
    console.log(window.WebViewJavascriptBridge, '桥数据')
    if (window.WebViewJavascriptBridge) {
      window.WebViewJavascriptBridge.callHandler(
        'openUrlWithParam',
        { url: urlPath, param: {} },
        null
      )
    }
  })
}
</script>

<style lang="less" scoped>
.ad {
  margin: 0px 32px 10px;
  img {
    width: 100%;
    height: auto;
    border-radius: 20px;
  }
}
</style>
